package org.jeecg.modules.config;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class InitSiteDataConfig implements InitializingBean {
	
	@Value("${jeecg.site.appName}")
	private String appName;
	@Value("${jeecg.site.appDesc}")
	private String appDesc;
	@Value("${jeecg.site.appLogo}")
	private String appLogo;
	@Value("${jeecg.site.allowForgetPass}")
	private boolean allowForgetPass;
	@Value("${jeecg.site.allowRegister}")
	private boolean allowRegister;
	@Value("${jeecg.site.allowPhoneLogin}")
	private boolean allowPhoneLogin;
	@Value("${jeecg.site.allowThirdLogin}")
	private boolean allowThirdLogin;
	@Value("${jeecg.site.helpPath}")
	private String helpPath; 

	public static Map<String, Object> SITE_PARAM = new HashMap<>();
	
	@Override
	public void afterPropertiesSet() throws Exception {
		SITE_PARAM.put("appName", appName);
		SITE_PARAM.put("appDesc", appDesc);
		SITE_PARAM.put("appLogo", appLogo);
		SITE_PARAM.put("allowForgetPass", allowForgetPass);
		SITE_PARAM.put("allowRegister", allowRegister);
		SITE_PARAM.put("allowPhoneLogin", allowPhoneLogin);
		SITE_PARAM.put("allowThirdLogin", allowThirdLogin);
		SITE_PARAM.put("helpPath", helpPath);
	}

}
